package com.liangwj.springbootdesignpatterns.createTypePatterns.builder.demo_2;
/**
 * <b>Description:</b> Director：调用具体建造者来创建复杂对象的各个部分，在指导者中不涉及具体产品的信息，只负责保证对象各部分完整创建或按某种顺序创建。 <br/>
 * @author Lingwenjun
 * @date 2019/1/22-17:29
 * @version 1.0
 */
public class Director {

    private Human human;

    public Human createHumanByDirector(IBuilderHuman builderHuman) {
        builderHuman.buildHead();
        builderHuman.buildBody();
        builderHuman.buildHands();
        builderHuman.buildFoots();
        human = builderHuman.createHuman();
        return human;
    }

    public void showHuman() {
        System.out.println("human:");
        System.out.println("human head:" + human.getHead());
        System.out.println("human body:" + human.getBody());
        System.out.println("human hands:" + human.getHands());
        System.out.println("human foots:" + human.getFoots());
    }
}
